#ifndef _ROS_robot_msgs_Rack_h
#define _ROS_robot_msgs_Rack_h

#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"

namespace robot_msgs
{

  class Rack : public ros::Msg
  {
    public:
      typedef uint8_t _id_type;
      _id_type id;
      typedef uint8_t _rack_id_h_type;
      _rack_id_h_type rack_id_h;
      typedef uint8_t _rack_id_l_type;
      _rack_id_l_type rack_id_l;
      typedef int32_t _rack_type_type;
      _rack_type_type rack_type;
      typedef int8_t _rack_dir_type;
      _rack_dir_type rack_dir;
      typedef uint8_t _rack_busy_type;
      _rack_busy_type rack_busy;

    Rack():
      id(0),
      rack_id_h(0),
      rack_id_l(0),
      rack_type(0),
      rack_dir(0),
      rack_busy(0)
    {
    }

    virtual int serialize(unsigned char *outbuffer) const
    {
      int offset = 0;
      *(outbuffer + offset + 0) = (this->id >> (8 * 0)) & 0xFF;
      offset += sizeof(this->id);
      *(outbuffer + offset + 0) = (this->rack_id_h >> (8 * 0)) & 0xFF;
      offset += sizeof(this->rack_id_h);
      *(outbuffer + offset + 0) = (this->rack_id_l >> (8 * 0)) & 0xFF;
      offset += sizeof(this->rack_id_l);
      union {
        int32_t real;
        uint32_t base;
      } u_rack_type;
      u_rack_type.real = this->rack_type;
      *(outbuffer + offset + 0) = (u_rack_type.base >> (8 * 0)) & 0xFF;
      *(outbuffer + offset + 1) = (u_rack_type.base >> (8 * 1)) & 0xFF;
      *(outbuffer + offset + 2) = (u_rack_type.base >> (8 * 2)) & 0xFF;
      *(outbuffer + offset + 3) = (u_rack_type.base >> (8 * 3)) & 0xFF;
      offset += sizeof(this->rack_type);
      union {
        int8_t real;
        uint8_t base;
      } u_rack_dir;
      u_rack_dir.real = this->rack_dir;
      *(outbuffer + offset + 0) = (u_rack_dir.base >> (8 * 0)) & 0xFF;
      offset += sizeof(this->rack_dir);
      *(outbuffer + offset + 0) = (this->rack_busy >> (8 * 0)) & 0xFF;
      offset += sizeof(this->rack_busy);
      return offset;
    }

    virtual int deserialize(unsigned char *inbuffer)
    {
      int offset = 0;
      this->id =  ((uint8_t) (*(inbuffer + offset)));
      offset += sizeof(this->id);
      this->rack_id_h =  ((uint8_t) (*(inbuffer + offset)));
      offset += sizeof(this->rack_id_h);
      this->rack_id_l =  ((uint8_t) (*(inbuffer + offset)));
      offset += sizeof(this->rack_id_l);
      union {
        int32_t real;
        uint32_t base;
      } u_rack_type;
      u_rack_type.base = 0;
      u_rack_type.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
      u_rack_type.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
      u_rack_type.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
      u_rack_type.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
      this->rack_type = u_rack_type.real;
      offset += sizeof(this->rack_type);
      union {
        int8_t real;
        uint8_t base;
      } u_rack_dir;
      u_rack_dir.base = 0;
      u_rack_dir.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
      this->rack_dir = u_rack_dir.real;
      offset += sizeof(this->rack_dir);
      this->rack_busy =  ((uint8_t) (*(inbuffer + offset)));
      offset += sizeof(this->rack_busy);
     return offset;
    }

    const char * getType(){ return "robot_msgs/Rack"; };
    const char * getMD5(){ return "b806b45226e867ffb64eba74decd3d28"; };

  };

}
#endif